#include"LeftistHeaps.h"


int main()
{
	int input;
	int minValue;
	Lheap heap;
	Lheap heap2;
	Lheap * heapP = 0;
	heapP = &heap;
	while (1)
	{
		cin >> input;
		if (input == 444)
			heapP->desc();
		else if (input == 44)
		{
			heapP->deleteMin(&minValue);
			cout << "minimal value= " << minValue << endl;
		}
		else if (input == 4)
			break;
		else if (input == 13)
		{
			if (heapP == &heap)
				heapP = &heap2;
			else{
				heapP = &heap;
			}
		}
		else if (input == 17)
		{
			heap.merge(heap2);
		}
		else if (input == 33)
		{
			heap = heap2;
		}
		else{
			heapP->insert(input);
		}
	}
	


	system("pause");
	return 0;
}